package dao

import "shopping-order/global"

func AddFile[T any](data *T) {
	global.DB.Create(&data)
}

func GetOneByFile[T any](where *T, data *T) error {
	return global.DB.Where(where).Limit(1).Find(&data).Error
}

func GetListByFile[T any](where *T, data *[]T) error {
	return global.DB.Where(where).Find(&data).Error
}
